#!/bin/bash

# 创建一个临时文件来存储SQL指令
temp_sql_file=$(mktemp)

# 将指令写入临时文件
cat <<EOF > $temp_sql_file
drop table warehouse;
create table warehouse (w_id int, name char(8));
insert into warehouse values (534, 'asdfhjkl');
insert into warehouse values (500,'bgtyhnmj');
insert into warehouse values (100,'qwerghjk');
insert into warehouse values (10 , 'qweruiop');
create index warehouse(w_id);
drop index warehouse(w_id);
create index warehouse(name);
drop index warehouse(name);
create index warehouse(w_id,name);
select * from warehouse where w_id = 500;
EOF

# 启动rmdb并将指令传入
./build/rmdb_client  < $temp_sql_file
rm $temp_sql_file
